//
//  ConfirmViewController.h
//  cherryPicker
//
//  Created by Young Soo Yun on 12. 1. 5..
//  Copyright (c) 2012 Happy. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "CherryPickerDB.h"

typedef enum{
    TAG_CARDNAME = 6,
    TAG_DATE,
    TAG_CATEGORY,
    TAG_PLACE,
}ConfirmPickerViewTag;

typedef enum{
    CREATE_RECEIPT = 0,
    MODIFY_RECEIPT,
}ConfirmType;

@protocol ConfirmVCDelegate <NSObject>

- (void)ConfirmPickerView:(NSInteger)tag
                  labText:(NSString*)labText;
- (void)ConfirmOKClick;
- (void)ConfirmCancelClick;
- (void)ConfimKeyBoard:(BOOL)isON;

@optional

- (void)ConfimDelClick;

@end

@interface ConfirmViewController : UIViewController<
UITextFieldDelegate
>{
    IBOutlet UILabel* _labTitle;
    IBOutlet UILabel* _labCardName;
    IBOutlet UILabel* _labDate;
    IBOutlet UILabel* _labCategory;
    IBOutlet UILabel* _labPlace;
    IBOutlet UITextField* _tfPrice;
    IBOutlet UITextField* _tfDiscount;
    
    IBOutlet UIButton* _btnDel;
    
    IBOutlet UIView* _unmodifyView;
    
    id<ConfirmVCDelegate> _delegate;
    
    NSString* _strDelimiter;
    NSInteger _ID;
    
    BOOL _isModify;
}

@property (nonatomic, assign) id<ConfirmVCDelegate> _delegate;

- (void)initType:(ConfirmType)type;

- (void)initList:(NSString*)cardName
       delimiter:(NSString*)delimiter
       checkDate:(NSString*)checkDate
        strPrice:(NSString*)strPrice;
- (void)initData:(ReceiptDB*)receiptDB;
- (void)setDate:(NSString*)checkDate;
- (void)setLabel:(NSString*)labText
             tag:(NSInteger)tag;

- (IBAction)onPickerView:(id)sender;
- (IBAction)onOK;
- (IBAction)onCancel;
- (IBAction)onDel;

@end
